<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link rel="stylesheet" href="/static/weui/css/weui.css">
		<link rel="stylesheet" href="/static/weui/css/weuix.css">
		<link rel="stylesheet" href="/static/weui/css/mydmcss.css?r=1">
		<link rel="stylesheet" href="/static/weui/css/animate-mini.css" />
		<script src="/static/weui/js/zepto.min.js"></script>
		<script src="/static/weui/js/zepto.weui.js"></script>
		<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
		<script>
			var tdesc='{$cuser["nickname"]}邀请您，点亮消防安全，共建平安牛城。';
		</script>
		<script src="/static/weui/js/xf.js"></script>
	<title>我的</title>
</head>
<body ontouchstart>
	<div class="weui-header" > 
		<div class="weui-header-left" onclick="javascript:history.back(-1)"> <a  class="icon icon-109 f-white"></a>  </div>
		 <h1 class="weui-header-title"></h1>
	</div>  
	<div class="titleimg">
		<img src="/static/weui/images/dm/dmrank.jpg">
	</div>
	<div class="page-hd" style="padding: 0px;">
			<div class="weui-panel__bd">
				<a href="javascript:void(0);" class="weui-media-box weui-media-box_appmsg">
					<div class="weui-media-box__hd">
						<div class="weui-avatar-circle">
							<img src="{$cuser['headimgurl']}" />
							</div>
					</div>
					<div class="weui-media-box__bd">
						{if ($cuser['score']>0)}
						<h4 class="weui-media-box__title" style="font-size: 14px;">{$cuser['nickname']}<br />灯谜PK赛得分 <span class="f-red f18">{$cuser['score']}</span> 排名 <span class="f-red f18">{$cuser['rank']}</span></h4>
			
		                {else /}
						<h4 class="weui-media-box__title" style="font-size: 14px;">{$cuser['nickname']}，您未进入前200名</h4>
						
		                {/if}
						<p class="weui-media-box__desc">猜灯谜前200名用户请于2月20日（上午10:00）前，点击“奖品”完善领奖信息，工作人员会与您电话联系。</p>
					</div>
					
				</a>
			
			</div>
			<div class="text-center" style="width: 100%; ">
				{if (!$cuser['hasaddress'])}
				<div style="width: 100%; text-align: right;">
				<a href="javascript:showmsgdiv()">完善领奖信息<span class="icon icon-10"></span></a> <br />
				</div>
				{/if}
               

				<div class="weui-cells weui-cells_form" style="margin-top: 20px; display: none;" id="msgdiv">
					<div class="weui-cell">
						<div class="weui-cell__hd"><label class="weui-label">姓名</label></div>
						<div class="weui-cell__bd">
							<input class="weui-input" placeholder="请输入姓名" id='uname' type="text">
						</div>
					</div>
					<div class="weui-cell">
						<div class="weui-cell__hd">
							<label class="weui-label">手机号</label>
						</div>
						<div class="weui-cell__bd">
							<input class="weui-input" placeholder="请输入手机号" id='phone' type="tel">
						</div>
				
					</div>
					<div class="weui-cell">
						<div class="weui-cell__hd">
							<label class="weui-label">领奖区域</label>
						</div>
						<div class="weui-cell__bd">
							<input class="weui-input" id="qy" placeholder="请选择领奖区域" >
						</div> 
				
					</div>
					<div style="text-align: center;">
						<button class="weui-btn weui-btn_mini  bg-blue" style="margin-top: 10px;" onclick="baocun()">保存信息</button>
					</div>
					</div>
					
			</div>
			<script>
				function baocun()
				{	
					var sname=$("#uname").val();
					var phone=$("#phone").val();
					var address=$("#qy").val();
					if(sname=="" || phone=="" || address=="")
					{
						$.toast("请完善信息后提交",'text');
						return false;
					}
					//return false
					$.showLoading();
					var data={sname:sname,phone:phone,address:address};
					$.ajax({
					data:data,
					type: "POST",
					url:'address',
					async: true,
					success: function(data) {
						$.hideLoading();
						$.toast("保存成功！",'text');
						
						$("#msgdiv").hide();
						//window.location.reload();
					}
				})
			   }
			   function showmsgdiv()
			   {
				   $("#msgdiv").show();
			   }
				
				$(function(){

		var dllist=[{"title":"襄都区","value":"1"},{"title":"信都区","value":"2"},{"title":"开发区","value":"3"},{"title":"任泽区","value":"4"},{"title":"南和区","value":"5"},{"title":"临城县","value":"6"},{"title":"内丘县","value":"7"},{"title":"柏乡县","value":"8"},{"title":"隆尧县","value":"9"},{"title":"沙河市","value":"10"},{"title":"新河县","value":"11"},{"title":"巨鹿县","value":"12"},{"title":"南宫市","value":"13"},{"title":"平乡县","value":"14"},{"title":"广宗县","value":"15"},{"title":"威县","value":"16"},{"title":"清河县","value":"17"},{"title":"临西县","value":"18"},{"title":"宁晋县","value":"19"},];
	    var dlse=$("#qy").select({
        title: "请选择领奖区域",
        items: dllist,
		beforeClose: function(values, titles) {
        },
        onChange: function(d) {
           // console.log(d,1);
        },
        onClose: function (d) {
			//console.log(d.data.titles,'提交数据库');
		}
      });
	})
</script>	
	</div>
</body>
</html>